<?php

namespace Common\Service;


/** 
 * 点赞
 * @author Legend. <xcx_legender@qq.com>
 * @param 
 * @return 
 */

Class LikeService extends BaseService
{


	/** 
	 type: 0: 视频 1: 比赛  2: 用户
	 uid : 用户ID
	 target_id : 对象ID
	 */
	
	const TYPE_VIDEO = 0;
	const TYPE_MATCH = 1;


    public function countByVideo($video_id)
    {
        $map = [
            'target_id' => (int)$video_id,
            'type'      => ['in', [0,1]],
        ];
        return $this->where($map)->count();
    }

}